<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>字符串</title>
	</head>
	<body>
		<script>
			let str = "foo";
			for (let c of str) {
				console.log(c); //将字符串中的字符迭代出来
			}

			let firstName = "尼古拉斯";
			let lastName = "赵四";
			console.log(
				`     <ul>
			      <li>${firstName}</li>
				   <li>${lastName}</li>
			    </ul>`.trim()
			);
			
			console.log(`fullName:${firstName}.${lastName}`);
			
			let x=1;
			let y=2;
			console.log(`${x+y*2}`);//5
			let obj={x:1,y:2}
			console.log(`${obj.x + obj.y}`);//3
			
			function func(){
				return "Hello ES6"
			}
			
			console.log(`func被调用:${func()}`);
			
			const temp= addrs=>`
			  <table>
			  ${addrs.map(addr =>`<tr><td>${addr.first}</td><td>${addr.last}</td></tr>`).join('')}
			  </table>`;
			  
			const datas=[
				{first:'Hao',last:"Ren"},
				{first:'Tom',last:"lily"}
			];
			console.log(temp(datas));
			
			 
			 
			
			  
		</script>
	</body>
</html>
